Search
Other Sourcerer questions
Forum

Using {source} with PHP in AMM HTML after field

Michael Hermary's Avatar Michael Hermary
Hello,

I have setup a menu module and want to display a dynamic copyright year and possibly the site's name at the end using the HTML after field in AMM. I have tried adding the following without success.
{source}
&copy; <?php echo date( 'Y' ); ?>
{/source}
When the page loads, the following error is returned:
0 - RegularLabs\Library\Php::execute(): Argument #2 ($rl_article) must be of type ?object, string given, called in /var/www/development/plugins/system/sourcerer/src/Replace.php on line 732
Is this at all possible with the HTML after field in AMM?

I have read the plugin ordering support article and have the Sourcerer system plugin before AMM. I am not sure if this would provide any assistance.

Cheers,
Peter van Westen's Avatar Peter van Westen ADMIN
Please try the latest development version from:
regularlabs.com/development-releases
Please post a rating at the Joomla! Extensions Directory
Michael Hermary's Avatar Michael Hermary
Hello Peter,

The dev release worked perfectly for the following:
{source}
&copy; <?php echo date('Y'); ?> <?php echo htmlspecialchars( $app->get( 'sitename' ), ENT_QUOTES, 'UTF-8' ); ?>
{/source}
Thanks for your prompt assistance!

Cheers,
Peter van Westen's Avatar Peter van Westen ADMIN
Ok, great 🙂
The fix will be included in the next release.
Please post a rating at the Joomla! Extensions Directory
You can only post on the extension support forum if you have an active subscription and you log in

Buy a Pro subscription